<extend name="Public:template" />
<block name="page_header">
	<include file="Public:header_with_title"/>
</block>
<block name="page_body">


<div class="row mt20" style="border:5px solid #fcfcfc">
	<div class="span1"></div>
	<div class="span10 mt20">
		<img src="http://imgout.ph.126.net/22002062/lunxun3.jpg" width="480" alt="利客送">
	</div>
	<div class="span8 pull-right mt20">
		<div id="alert_box">
		<div class="alert-sm alert-success" style="display:none"></div>
		<div class="alert-sm alert-danger" style="display:none"></div>
		</div>
		<form action="{:U('CustPassport/doLogin')}" method="post" id="form_edit" name="form_edit" role="form">
			<input type="hidden" name="lastUrl" value="{$lastUrl}">
			
			<div class="input-append input-prepend">
				<span class="btn btn-warning">帐号</span>
				<input type="text" class="input-large"  id="cust_account" name="cust_account" placeholder="请输入手机号码">
			</div>
			
			<div class="input-append input-prepend">
				<span class="btn btn-warning">密码</span>
				<input type="password" class="input-large"  id="cust_pass" name="cust_pass" placeholder="请输入密码">
			</div>
			<div class="checkbox mt15">
				<label>
					<input type="checkbox" id="keep_login" name="keep_login" value="1" >记住我的登录状态
				</label>
			</div>
		</form>
		<button type="button"  class="btn btn-success btn-large  pull-right" onclick="redirect('{:U('CustPassport/showRegist')}')">马上注册</button>
		<button type="button" id="doLoginBtn" class="btn btn-warning btn-large">立即登录</button>
	</div>
</div>



</block>
<block name="script_footer">
<script type="text/javascript">
$(document).ready(function(){
	$("#doLoginBtn").on( "click", function(e) {
		$("#alert_box .alert-danger").hide();
		$("#alert_box .alert-success").hide();
		$.ajax({
	        'url': $("#form_edit").attr("action"),
	        'type':"post",
	        'dataType': "json",
	        'data': $('#form_edit').serialize(),
	        'success': function (data) {
	        	var error = data['error'];
	        	var message = data['message'];
	        	if(error=='0'){
	        		$("#alert_box .alert-success").html(message).show;
	        		var lastUrl = document.forms['form_edit'].lastUrl.value;
	        		document.location.href="{:U('jumpLastUrl')}?lastUrl="+lastUrl;
	        	}else{
	        		$("#alert_box .alert-danger").html(message).show();
	        	}
	        }
	    });
	});
})
</script>
</block>